package com.changgou;

import com.cahnggou.system.GateWayApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.BoundValueOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.UUID;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = GateWayApplication.class)
public class UUIDtest {
    @Autowired
    private RedisTemplate redisTemplate;

    @Test
    public void test(){
        ValueOperations valueOperations = redisTemplate.opsForValue();
        valueOperations.set("ids", 1);
        Object ids = valueOperations.get("ids");
        System.out.println(ids);
        for (int i = 0; i < 10; i++) {
            Long ids1 = valueOperations.increment(1);
            System.out.println(ids1);
        }

    }
}
